package com.xiangban.yanglaodajie_platform.controller;

import com.xiangban.yanglaodajie_platform.entity.AppRelease;
import com.xiangban.yanglaodajie_platform.entity.res.ApiResult;
import com.xiangban.yanglaodajie_platform.service.VersionsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/release")
public class VersionsController {
    @Autowired
    private VersionsService versionsService;

    @RequestMapping("/lastRelease")
    public ApiResult<AppRelease> getLastRelease(@RequestBody AppRelease appRelease){
        AppRelease resAppRelease = versionsService.getLastRelease(appRelease);

        return ApiResult.newSuccess(resAppRelease);
    }
}
